class Book(string title, string author) : IEquatable<Book>
{
    public string Title { get; set; } = title;
    public string Author { get; set; } = author;

    public void DisplayBookDetails()
    {
        Console.WriteLine($"书名：{Title}, 作者：{Author}");
    }

    public override string ToString()
    {
        return $"书名: {Title}, 作者: {Author}";
    }

    public bool Equals(Book? other)
    {
        if (other == null)
            return false;

        return Title == other.Title && Author == other.Author;
    }

    public override int GetHashCode()
    {
        return HashCode.Combine(Title, Author);
    }
}